<script setup lang="ts">
import { Ref, ref } from 'vue'
import { User, CircleCheck, Lock, Iphone } from '@element-plus/icons-vue'
import Wechat from '@/assets/icons/Wechat.vue'
const activeLoginType: Ref<string> = ref('account')
const changeLoginType = (tab, event): void => {
  console.log(tab, event)
}
const formUserData = ref({
  name: '',
  password: ''
})
</script>

<template>
  <div class="login">
    <div class="left">
      <div class="nav-title">
        <h1>小鹿线</h1>
        <h3>客户关系管理系统</h3>
        <p>让业务在线更高效，加速企业数字化升级。</p>
      </div>
      <div class="l-img">
        <img src="@/assets/images/data.png" alt="" />
      </div>
      <div class="l-footer">
        <p>©小鹿线客户管理系统 1.0.11</p>
      </div>
    </div>
    <div class="right">
      <div class="r-menu"></div>

      <div class="r-nav">
        <img src="@/assets/images/logo.png" alt="" />
        <h1>小鹿线客户管理系统</h1>
      </div>
      <div class="r-main">
        <el-tabs v-model="activeLoginType" @tab-click="changeLoginType">
          <el-tab-pane label="账号登录" name="account">
            <el-form v-model="formUserData">
              <el-form-item prop="name">
                <el-icon><User /></el-icon>
                <input v-model="formUserData.name" type="text" placeholder="用户名" />
              </el-form-item>
              <el-form-item prop="password">
                <el-icon><Lock /></el-icon>
                <input v-model="formUserData.password" type="text" placeholder="请输入密码" />
              </el-form-item>
              <div class="yzm">
                <el-form-item prop="yanzhengma">
                  <el-icon><CircleCheck /></el-icon>
                  <input type="text" placeholder="请输入验证码" />
                </el-form-item>
                <img src="" alt="" />
              </div>
            </el-form>
            <div class="r-account-footer">
              <el-checkbox>记住密码</el-checkbox>
              <a href="javascript:;">忘记密码？</a>
            </div>
            <el-button type="primary" round class="login-btn">登录</el-button>
          </el-tab-pane>
          <el-tab-pane label="手机号登录" name="telephone">
            <el-form>
              <div class="telephone">
                <el-button>+86</el-button>
                <el-form-item>
                  <el-icon><Iphone /></el-icon>
                  <input type="text" placeholder="请输入手机号">
                </el-form-item>
              </div>
              <div class="dxyzm">
<!--                短信验证码-->
                <el-form-item>
                  <el-icon><Lock /></el-icon>
                  <input type="text" placeholder="请输入短信验证码">
                </el-form-item>
                <el-button> 获取短信验证码</el-button>
              </div>
            </el-form>
          </el-tab-pane>
        </el-tabs>
      </div>

      <div class="r-footer">
        <p>其他登录方式</p>
        <div class="wechat">
          <Wechat />
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.login {
  width: 100vw;
  height: 100vh;
  display: flex;
  .left {
    width: 40%;
    height: 100%;
    padding: 20px;
    /*noinspection CssUnknownTarget*/
    background: url('@/assets/images/auth_banner.jpg') no-repeat;
    .nav-title {
      h1 {
        font-weight: 700;
        font-size: 38px;
        color: white;
      }
      p {
        font-size: 14px;
        color: #aeaaaa;
        margin-top: 10px;
        margin-bottom: 20px;
      }
    }
    .l-img {
      height: 350px;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-top: 40px;
      margin-bottom: 40px;
      img {
        width: 280px;
        height: 280px;
      }
    }
    .l-footer {
      margin-top: 20px;
      p {
        font-size: 12px;
      }
    }
  }
  .right {
    width: 60%;
    color: #1b1b1f;
    position: relative;
    .r-menu {
      height: 100px;
    }
    .r-nav {
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        width: 45px;
        height: 45px;
      }
      h1 {
        display: inline-block;
        color: #1b1b1f;
        font-size: 26px;
        margin-left: 20px;
        font-weight: 700;
      }
    }
    .r-main {
      width: 80%;
      margin: 0 auto;
      margin-top: 40px;
      :deep(.el-form-item__content) {
        padding: 10px;
        border-radius: 5px;
        border: 1px solid #ccc;
        display: flex;
        width: 100%;
        input {
          border: none;
          width: calc(100% - 50px);
          margin-left: 10px;
          &.active {
            border: none;
          }
        }
      }
      .yzm {
        display: flex;
        :deep(.el-form-item) {
          width: calc(100% - 50px);
        }
        img {
          margin-left: 10px;
          width: 120px;
          height: 40px;
        }
      }
      .r-account-footer {
        margin-top: 20px;
        display: flex;
        justify-content: space-between;
        a {
          font-size: 14px;
        }
      }
      .login-btn {
        width: 100%;
        height: 40px;
      }
      .telephone{
        display: flex;
        button{
          width: 60px;
          height: 40px;
          border-radius: 5px 0 0 5px;
        }
        :deep(.el-form-item){
          width: calc(100% - 60px);
          .el-form-item__content{
            border-radius: 0 5px 5px 0;
          }
        }
      }
      .dxyzm{
        display: flex;
        .el-form-item{
          width: calc(100% - 130px);
        }
        button{
          width: 120px;
          height: 40px;
          margin-left: 10px;
        }
      }
    }
    .r-footer {
      width: 80%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: absolute;
      bottom: 20px;
      left: 10%;
      p {
        width: 100%;
        font-size: 14px;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        &::after,
        &::before {
          content: '';
          width: 38%;
          height: 1px;
          background: #e1e3e3;
        }
      }
      .wechat {
        width: 40px;
        height: 40px;
        padding: 10px;
        background: #67c23a;
        border-radius: 50%;
        svg {
          fill: white;
        }
      }
    }
  }
}
</style>
